package com.car.account.interceptor;

import com.car.commons.web.util.WebUtil;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

@Component
public class TokenInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate template) {
        String token = WebUtil.getRequest().getHeader("car-token");
        if(token != null) {
            template.header("car-token", token);
        }
    }
}
